home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / savage.zip / SAV6HRT.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-03  |  793b  |  34 lines

  1. program savage;         { 3/30/91, 9/9/89, ljr }
  2.  
  3. uses tphrt;       { RYLE's }
  4.  
  5. const
  6.   iloop = 2500;
  7. var
  8.   hits, elapsed, i : longint;
  9.   a : real;
  10.  
  11.   function tan (a:real) : real;
  12.  
  13.   begin
  14.     tan := sin (a) / cos (a);
  15.   end;
  16.  
  17. begin
  18.   a := 1.0;
  19.   t_start;                             { init the timer }
  20.   write('SAVAGE (MATH) BENCHMARK ');
  21.  
  22.   write('start...');
  23.   t_entry(1);                         { start the timer }
  24.   for i := 1 to iloop do begin
  25.       a := tan(arctan(exp(ln(sqrt(a * a))))) + 1;
  26.     end;
  27.   t_exit(1);                           { stop the timer }
  28.   t_stop;                              { un-init the timer }
  29.   t_ask_timer(1,hits,elapsed);
  30.   write('stop!   ');
  31.   writeln ('Elapsed time was ',
  32.   (elapsed/1000000.0):10:6,' seconds.');
  33. end.
  34.